<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'list.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet"
	href="<%=path%>/script/ztree_3.3/css/zTreeStyle/zTreeStyle.css"
	type="text/css" />
<script type="text/javascript"
	src="<%=path%>/script/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/script/ztree_3.3/js/jquery.ztree.all-3.3.js"></script>
<script type="text/javascript" src="<%=path%>/script/jquery.json-2.4.js"></script>

<script language="javascript">
jQuery(function(){
	//相当于body的onload事件
	var setting = {
		data: {
			simpleData: {
				enable: true
			}
		},
			callback: {
				onClick: function(event, treeId, treeNode){
					var node_id=treeNode.id;
					var node_name=treeNode.name;
					var dic_iframe=document.getElementById("dic_iframe");
					var loadURL="<%=path%>/dictionaryAction!childList?parent_id="+ node_id + "&date=" + new Date() + "";
					dic_iframe.src = loadURL;  //在这个框架打开这个loadURL

				}
			}

		};
		var treeListStr = '${requestScope.treeDate}';

		//将json的字符串转为josn对象。
		var treeData = jQuery.evalJSON(treeListStr);
		jQuery.fn.zTree.init($("#treeDemo"), setting, treeData);

	});
</script>
</head>

<body style="margin: 2px; padding: 2px;">
	<table width="100%" border="1" style="margin: 0px; padding: 0px;">
		<tr>
			<td width="15%" valign="top">
				<div class="zTreeDemoBackground left">
					<ul id="treeDemo" class="ztree"></ul>
				</div>
			</td>
			<td width="85%"><iframe height="100%" width="100%" border="0"
					scrolling="no" frameborder="0" src="" name="dic_iframe"
					id="dic_iframe"></iframe></td>
		</tr>
	</table>
</body>
</html>
